<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>


        // 赋值运算  
        //   =   +=    -=    *=   /=     %= 


        // 变量的值只会通过赋值才会发生改变


        var age = 18;  // 赋值运算

        age + 1;
        console.log(age);   // 18

        // 通过赋值运算   age在自身的基础上自增1
        age = age + 1;
        console.log(age);   // 19


        // 简写   
        age += 1;    // age = age + 1 的简写
        console.log(age);  // 20

        age -= 1;    // age = age - 1 的简写
        console.log(age);  // 19

        age *= 2;
        console.log(age);   // 38

        age /= 2;
        console.log(age);   // 19

        age %= 2;    // age = age % 2 
        console.log(age);   // 1





    </script>

</body>

</html>